

<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="200px">
        <leftlistVue></leftlistVue>
      </el-aside>
      <el-container>
        <el-header>
          <el-button type="success" @click="tuichudenglu">退出登录</el-button>
        </el-header>
        <el-main><router-view /></el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script lang="ts" setup>
import router from "@/router";
import leftlistVue from "./leftlist.vue";
import { ElMessage, ElMessageBox } from 'element-plus'
function tuichudenglu() {
  ElMessageBox.confirm(
    '确定退出登录吗？',
    {
      confirmButtonText: '确定',
      cancelButtonText: '取消',
      type: 'warning',
    }
  )
    .then(() => {
      ElMessage({
        type: 'success',
        message: '成功退出',
      })
      sessionStorage.clear();
      router.push("/Login")
    })
    .catch(() => {
      ElMessage({
        type: 'info',
        message: '取消',
      })
    })


}
</script>
<style lang="scss" scoped>
.common-layout {
  width: 100%;
  height: 100%;
}

.el-container {
  width: 100%;
  height: 100%;
}

.el-aside {
  width: 15%;
  height: 100%;
  background-color: aquamarine;
}

.el-header {
  width: 100%;
  height: 10%;
  background-color: beige;
}

.el-main {
  width: 100%;
  flex: 1;
  background-color: burlywood;
}

.el-button {
  margin-left: 1250px;
  margin-top: 50px;
}
</style>
